import { Button, Form, Input, Select } from "antd"
import {salesList} from "../../pages/customer/index"
//给潜在客户分配跟进人
export const AllocationEmploye=(props)=>{
    const id=props.id;
  
       const [assignForm] = Form.useForm();
        

       // 确认分配跟进人并添加跟进记录
const handleConfirmAssignAndAddFollow = async () => {
  try {
    await assignForm.validateFields();
    const values = assignForm.getFieldsValue();
  
    console.log(values,';;;;')

    // 提交成功后提示
   // message.success(`已为【${selectedCustomer.name}】分配跟进人并添加跟进记录`);
   
    assignForm.resetFields();
  } catch (error) {
    console.log("表单验证失败：", error);
  } finally {
    setAssignLoading(false);
  }
};
return <>
<div className="modal-box">
      <Form
                    form={assignForm}
                    layout="vertical"
                >
                    <Form.Item
                        name="sales"
                        label="选择跟进人"
                        rules={[{ required: true, message: "请选择跟进人" }]}
                    >
                        <Select
                            placeholder="请选择跟进人"
                            style={{ width: "100%" }}
                        >
                            {salesList.map((sales) => (
                                <Option key={sales.key} value={sales.name}>
                                    {sales.name}
                                </Option>
                            ))}
                        </Select>
                    </Form.Item>
                    <Form.Item
                        name="followType"
                        label="跟进类型"
                        rules={[{ required: true, message: "请选择跟进类型" }]}
                    >
                        <Select placeholder="请选择跟进类型">
                            <Option value="1">电话</Option>
                            <Option value="2">微信</Option>
                            <Option value="3">面谈</Option>
                            <Option value="4">邮件</Option>
                        </Select>
                    </Form.Item>
                    <Form.Item
                        name="followContent"
                        label="跟进内容详情"
                        rules={[{ required: true, message: "请输入跟进内容详情" }]}
                    >
                        <Input.TextArea rows={4} placeholder="请输入跟进内容详情" />
                    </Form.Item>
                    <Form.Item
                        name="result"
                        label="跟进结果"
                        rules={[{ required: true, message: "请选择跟进结果" }]}
                    >
                        <Select placeholder="请选择跟进结果">
                            <Option value="1">有意向</Option>
                            <Option value="2">无意向</Option>
                            <Option value="3">需再跟进</Option>
                        </Select>
                    </Form.Item>
                    <Form.Item name="remark" label="跟进备注信息">
                        <Input.TextArea rows={2} placeholder="请输入跟进备注信息" />
                    </Form.Item>
                </Form>
                <Button onClick={()=>handleConfirmAssignAndAddFollow()}>确认</Button>
</div>
</>
}